package mx.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import mx.entity.TicketType;
import mx.service.TicketTypeService;
import mx.utils.ResponseUtil;
import net.sf.json.JSONObject;

/**
 * 员工controller
 * 
 * @author root
 *
 */
@Controller
@RequestMapping("/ticketType")
public class TicketTypeController {

	@Resource
	private TicketTypeService ticketTypeService;

	@RequestMapping("/query")
	public String query(@RequestParam(value = "id", required = true) String id, HttpServletResponse response)
			throws Exception {
		TicketType ticketType = ticketTypeService.findById(Integer.parseInt(id));
		if (null != ticketType) {
			JSONObject result = JSONObject.fromObject(ticketType);
			ResponseUtil.write(response, result);
			result.put("status", true);
			ResponseUtil.write(response, result);
		}
		return null;
	}
}
